package com.example.demo.design.factory;

import com.example.demo.design.Facade.Square;

public class ShapeFactory {
    public Shape getShape(String shapeType){
        if(shapeType == null){
            return null;
        }
        if(shapeType.equalsIgnoreCase("CIRCLE")){
            return new Circle(); // Circle is a class in this package
        } else if(shapeType.equalsIgnoreCase("RECTANGLE")){
            return new Rectangle(); // Rectangle is a class in this package
        }
        return null;
    }

    public static void main(String[] args) {
        ShapeFactory shapeFactory = new ShapeFactory();
        Shape shape1 = shapeFactory.getShape("CIRCLE"); // Circle is a class in this package
        shape1.draw();
        Shape shape2 = shapeFactory.getShape("RECTANGLE"); // Rectangle is a class in this package
        shape2.draw();
    }
}
